<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>角色信息维护</title>
</head>
<body>
	<form id="_form" action="/role/edit" method="post">
		<form:errors /> 
		角色名称<input type="text" name="role" value="${role.role}"> <br>
		角色描述<input type="text" name="description" value="${role.description}">
		<br> <input type="checkbox"
			<c:if test="${role.available}">checked</c:if> name="available">
		可用否 <br> <input type="submit" value="提交">

		<c:if test="${role.id == null }">
			<input type="hidden" name="_method" value="post" />
		</c:if>
		<c:if test="${role.id != null }">
			<input type="hidden" name="id" value="${role.id}" />
			<input type="hidden" id="_method" name="_method" value="PUT" />
			<input type="button"
				onclick="_form.action='/role/edit/${role.id}';_method.value='DELETE';submit();"
				value="刪除">
		</c:if>
	</form>
</body>
</html>